package com.sanjiahantang.youjiaclient.module.login.beans;

import com.google.gson.Gson;
import com.sanjiahantang.youjiaclient.base.BaseBean;

/**
 * Created by zy on 2017/9/29.
 */

public class LoginBean extends BaseBean {


    /**
     * "code": 1003,
     "session": {
     "errorCount": 0,
     "ipStr": "172.16.60.31",
     "lastErrorTime": "2017-10-11T15:03:21.948",
     "lastLoginTime": "2017-10-11T14:58:57",
     "loginTypeId": "0",
     "phone": "18822185396",
     "token": "6f9b5952da9fb870fa1396dd205b37a7",
     "userSessionDto": {
     "expiredTime": "2017-10-11T15:54:22.301",
     "phone": "18822185396",
     "token": "6f9b5952da9fb870fa1396dd205b37a7",
     "userName": "高牛逼"
     }
     },
     "message": "登录成功"
     */
    private String data;

    public Data getData() {
        return new Gson().fromJson(data,Data.class);
    }

    public void setData(String data) {
        this.data = data;
    }

    public static class Data{
        private long code;
        private Session session;
        private String message;

        public long getCode() {
            return code;
        }

        public void setCode(long code) {
            this.code = code;
        }

        public Session getSession() {
            return session;
        }

        public void setSession(Session session) {
            this.session = session;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public static class Session{
        private int errorCount;
        private String ipStr;
        private String lastErrorTime;
        private String lastLoginTime;
        private String loginTypeId;
        private String phone;
        private String token;
        private String url;
        private Dto userSessionDto;
        private String fileId;

        public String getFileId() {
            return fileId;
        }

        public void setFileId(String fileId) {
            this.fileId = fileId;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getErrorCount() {
            return errorCount;
        }

        public void setErrorCount(int errorCount) {
            this.errorCount = errorCount;
        }

        public String getIpStr() {
            return ipStr;
        }

        public void setIpStr(String ipStr) {
            this.ipStr = ipStr;
        }

        public String getLastErrorTime() {
            return lastErrorTime;
        }

        public void setLastErrorTime(String lastErrorTime) {
            this.lastErrorTime = lastErrorTime;
        }

        public String getLastLoginTime() {
            return lastLoginTime;
        }

        public void setLastLoginTime(String lastLoginTime) {
            this.lastLoginTime = lastLoginTime;
        }

        public String getLoginTypeId() {
            return loginTypeId;
        }

        public void setLoginTypeId(String loginTypeId) {
            this.loginTypeId = loginTypeId;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public Dto getUserSessionDto() {
            return userSessionDto;
        }

        public void setUserSessionDto(Dto userSessionDto) {
            this.userSessionDto = userSessionDto;
        }
    }

    public static class Dto{
        private String expiredTime;
        private String phone;
        private String userName;

        public String getExpiredTime() {
            return expiredTime;
        }

        public void setExpiredTime(String expiredTime) {
            this.expiredTime = expiredTime;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }
    }
}
